import Vue from 'vue'
import VueRouter from 'vue-router'
import nprogress from 'nprogress'
import routemanger from './routemanger/manngeroute'
Vue.use(VueRouter)


//初始化路由
const routes = [
 ...routemanger
]
const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})
router.beforeEach((to, from, next) => {
  //发送前请求  动态添加   跳转
  nprogress.start()
  next()

})
router.afterEach(() => {
  nprogress.done()
})

export default router
